package com.song;

import com.song.model.Order;
import com.song.service.OrderService;
import com.song.service.ShopService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @ClassName : ShopConsumerMain
 * @Author : 司猫子
 * @Date: 2021/2/26 8:54
 */
public class ShopConsumerMain {
//    public static void main(String[] args) {
//        ClassPathXmlApplicationContext cpx = new ClassPathXmlApplicationContext("shop-consumer.xml");
//        OrderService service = (OrderService) cpx.getBean("remoteOrderService");
//        System.out.println("service="+service.getClass().getName());
//        Order order = service.createOrder(1001, "笔记本电脑", 5000f, 1);
//        System.out.println("调用远程服务的结果对象"+order);
//    }
public static void main(String[] args) {
    ClassPathXmlApplicationContext cpx = new ClassPathXmlApplicationContext("shop-consumer.xml");
    ShopService shopService = (ShopService) cpx.getBean("shopService");
    Order order = shopService.buy(1002, "手机", 3000f, 2);
    System.out.println("order="+order);

    }
}
